package com.wzy.spring2.interceptor;

import com.wzy.tools.utils.JSON;
import com.wzy.tools.utils.SpringUtils;
import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;

/**
 * @author Weizhengyun
 * @desc
 * @date 2022/12/17 上午10:56
 */

@Slf4j
public class PrintRunnable implements Runnable {

    @Override
    public void run() {
        while (true) {
            ExecutorService service = SpringUtils.getClass(ExecutorService.class);
            log.info("thread info = {}", JSON.toJSONString(service));
            System.out.println("thread info =" + JSON.toJSONString(service));
            try {
                TimeUnit.SECONDS.sleep(5);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
